{% extends 'base.html' %}

{% load markup %}

{% load pp_url %}
{% load topictags %}
{% load issuetags %}
{% load consensustags %}
{% load argumenttags %}
{% load solutiontags %}
{% load sourcetags %}
{% load tag_helpers %}
{% load commenttags %}

{% block title %}
{% if request.object %}{{ request.object.name|title }} {% endif %} Details
{% endblock %}

{% block browser_bar %}
					
{% endblock %}



{% block content %}

	<div class="stage">
		<div class="issuemask">
			 <div class="issuebound">


           {% pp_get_solution object=request.object %}

        {% pp_consensus_get object=pp_solution.solution.id user=request.user %}
                    
				    <div class="issue">


						    <div class="issueback2">
                                 
<div class="issheader">{{pp_solution.solution.name}}</div>

                            
<div class="userinfo">submitted by <a href="{% pp_url template='user_profile.html' dimension='i' object=pp_solution.solution.user%}">{{pp_solution.solution.user.username}}</a>  

{% pp_comment_count object=pp_solution.solution.id %}
                                                        
{{pp_solution.solution.submit_date|date:"(d/m/Y h:sA)"}} | {{ pp_comment.count }} comment{{ pp_comment.count|pluralize}} | {{pp_consensus.consensus.interest|floatformat:0 }} interest </div>

<div class="buttons">
<div class="iss_button">
{% ifequal pp_solution.solution.user request.user %}
                                    <a href="{% pp_url template='submit_solution.html' object=pp_solution.solution %}" class='small button blue'>edit</a>
                                    {% endifequal %}</div>




		                      {% include '_voting.html' %}
                          </div>


{% endpp_comment_count %}</div> 

    <div class="description">{{pp_solution.solution.text|markdown }}</div>


        {% include "_sourcetags.html" %}


    <div class="argument">
        

        <div class="yea_argument">
        <h2>Yea Arguments 
{% if request.user.is_authenticated %}
<a href="{% pp_url template='submit_yea_argument.html' object=pp_solution.solution %}">add new</a>
{% endif %}</h2>

        <ul>

             {% pp_get_argument_list object=pp_solution.solution arg_type="yea" %}

                        {% for arg in pp_argumentation.argument_list %}
                            <div class="argitr">
                            {% pp_consensus_get object=arg.id user=request.user %}
                                 <li> <b>{{pp_consensus.interest}}</b>  <a href="{% pp_url template='argument_detail.html' object=arg %}">{{arg.name}}</a> </li>
                            {% endpp_consensus_get %}
                 
                            </div>
                        
                        {% empty %} None at the moment.
                    {% endfor %}

                    {% endpp_get_argument_list %}

        </ul>

        </div>

        <div class="nay_argument">
        <h2>Nay Arguments 
{% if request.user.is_authenticated %}
<a href="{% pp_url template='submit_nay_argument.html' object=pp_solution.solution %}">add new</a>
{% endif %}</h2>
        <ul>

             {% pp_get_argument_list object=pp_solution.solution arg_type="nay" %}

                        {% for arg in pp_argumentation.argument_list %}
                            <div class="argitr">
                            {% pp_consensus_get object=arg.id user=request.user %}
                                 <li> <b>{{pp_consensus.interest}}</b><a href="{% pp_url template='argument_detail.html' object=arg %}">{{arg.name}}</a> </li>
                            {% endpp_consensus_get %}
                            </div>

                        {% empty %} None at the moment.
                        {% endfor %}

                    {% endpp_get_argument_list %}
            </ul>
            {% endpp_consensus_get %}

			</div>	</div>
            <div class="comments">
            {% include '_commentform.html' %}

            <div class="commentstructure">

            {% pp_comment_list_get user=request.user object=pp_solution.solution.id request=request %}

               {% comment %} {{ pp_comment.debug_comments }} {% endcomment %}
                {{ pp_comment.comments|safe }}

            {% endpp_comment_list_get%}
            {% endpp_get_solution %}
            </div>
            </div>
            </div>
            <div class="rightcol">

            {% include "_rightcol.html" %}

            	
	</div>			
</div>	</div>
    </div>
</body>
</html>


{% endblock content %}
